@import '@/styles/utils.scss';

.trigger {
  all: unset;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 8px;
  padding: 7px 16px;
  font-size: 13px;
  gap: 8px;
  background-color: #E8F1FF;
  color: #353535;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid #D9E5FF;

  &:hover {
    background-color: #D0DFF1;
  }

  &[data-state='open'] {
    background-color: #D0DFF1;
  }

  :global(.dark) & {
    color: #fff;
    background-color: transparent;
    border: 1px solid #3F4245;

    &:hover {
      background-color: #3F3F46;
    }

    &[data-state='open'] {
      background-color: #3F3F46;
    }
  }
}

.trigger[data-state='open'] {
  .selectIcon {
    transform: rotate(180deg);
  }
}

.triggerContent {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.pluginIcon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #353535;

  i {
    font-size: 16px;
  }

  :global(.dark) & {
    color: #D1D5DB;
  }
}

.content {
  overflow: hidden;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.08);
  animation: slideIn 0.2s ease-out;
  width: var(--radix-select-trigger-width);
  border: 1px solid #E4E4E7;
  padding: 6px;

  :global(.dark) & {
    background-color: #27272A;
    box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.2);
    border-color: #3F3F46;
  }
}

.pluginRow {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 0;
}

.item {
  all: unset;
  width: 100%;
  font-size: 13px;
  color: #353535;
  display: flex;
  align-items: center;
  padding: 6px 10px;
  height: 32px;
  position: relative;
  user-select: none;
  gap: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  border-radius: 8px;
  min-width: 0;
  box-sizing: border-box;

  &:hover {
    background-color: #F4F4F5;
  }

  &[data-highlighted] {
    background-color: #F4F4F5;
    outline: none;
  }

  &[data-state='checked'] {
    background-color: #F4F4F5;

    .itemCheckIcon {
      opacity: 1;
      color: #4F46E5;
    }
  }

  :global(.dark) & {
    color: #D1D5DB;

    &:hover {
      background-color: #3F3F46;
    }

    &[data-highlighted] {
      background-color: #3F3F46;
    }

    &[data-state='checked'] {
      background-color: #3F3F46;

      .itemCheckIcon {
        color: #818CF8;
      }
    }
  }
}


.pluginName {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
  line-height: 1.2;
  color: #353535;

  :global(.dark) & {
    color: #D1D5DB;
  }
}


.container {
  display: flex;
  align-items: center;
}

.title {
  font-weight: 600;
  font-size: 14px;
  color: #353535;

  :global(.dark) & {
    color: #D1D5DB;
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}